clc;clear;clearvars;
% 加载数据[data, label]([X,Y])
[data, label] = loadData();
% 初始化每个数据点的相对权重,创建数值均为1/num_row的num_row*num_col数组
num_row = size(data, 1);
num_col = size(data, 2);
weight = repmat(1 / num_row, num_row, 1);
T = 1;
[Boost_error, Boost_labels] = Boosting_decision_stump(data, weight, label, T);
fprintf("Boosting_decision_stump althgoritm T: %d, error is %.3f\n", T, Boost_error);
T = 10;
[Boost_error, Boost_labels] = Boosting_decision_stump(data, weight, label, T);
fprintf("Boosting_decision_stump althgoritm T: %d, error is %.3f\n", T, Boost_error);
T = 100;
[Boost_error, Boost_labels] = Boosting_decision_stump(data, weight, label, T);
fprintf("Boosting_decision_stump althgoritm T: %d, error is %.3f\n", T, Boost_error);